package com.fly.mhello.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.fly.mhello.service.HelloService;
import com.fly.mhello.util.Hello;

import base.util.Result;

@RestController
public class HelloAction {

	@Autowired
	HelloService helloService;
	
	@PostMapping(value = "/hello/{id}")
	public Result list(@PathVariable(name = "id") String myid,@RequestBody Hello arr) {
		System.err.println(myid);
		System.err.println(arr.toString());
		Hello hello = helloService.findAll(myid);
		System.err.println(hello.toString());
//		int a = 1/0;
		Result result = new Result("000", "查询成功", hello);
		return result;
	}
}
